package com.wxyzz.satserver.message.controller;

import com.wxyzz.common.core.common.R;
import com.wxyzz.satserver.message.entity.Message;
import com.wxyzz.satserver.message.service.IMessageService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/message")
@Api(tags ="消息api")
@CrossOrigin
public class MessageController {
    @Resource
    private IMessageService messageService;

    @GetMapping("/getmessage")
    @ApiOperation(value = "获取历史消息列表")
    public R getMessage(int sessionId){
        List<Message>  messageList = messageService.getMessage(sessionId);
        return R.ok(messageList);
    }
}
